package com.example.homework2;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class Recyclerview extends AppCompatActivity{

    RecyclerView list;
    List<Integer> num = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recyclerview);

        list = findViewById(R.id.list);

        for (int i = 0; i < 50; i++) {
            num.add(i);
        }

        RecyclerView_Adapter recyclerViewAdapter = new RecyclerView_Adapter(num);
        list.setAdapter(recyclerViewAdapter);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        list.setLayoutManager(layoutManager);
    }
}